Replace Cloudflare Worker with local Claude Agent SDK (zero API costs)#29
Replace Cloudflare Worker with local Claude Agent SDK (zero API costs)#29ingokpp wants to merge 1 commit intofarzaa:mainfrom
Conversation
Eliminate all external API costs by replacing the Cloudflare Worker proxy with local alternatives: - Claude API → local Node.js server using @anthropic-ai/claude-agent-sdk, which spawns the Claude Code CLI and inherits local session auth - ElevenLabs TTS → macOS NSSpeechSynthesizer (uses system voice including Siri voices, with AVSpeechSynthesizer fallback) - AssemblyAI STT → Apple Speech framework (already existed as fallback, now the default) The Cloudflare Worker is no longer needed — all three API routes are replaced with free, local alternatives that require no API keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hi, AppleTTSClient sets isSpeaking=true but only clears it via NSSpeechSynthesizerDelegate; if it falls back to AVSpeechSynthesizer there is no completion callback to reset isSpeaking, so CompanionManager can wait forever in scheduleTransientHideIfNeeded(). Severity: action required | Category: correctness How to fix: Track fallback speech completion Agent prompt to fix - you can give this to your LLM of choice:
Found by Qodo. Free code review for open-source maintainers. |
What this does
Replaces the Cloudflare Worker proxy with free, local alternatives — eliminating all external API costs:
@anthropic-ai/claude-agent-sdk, which spawns the Claude Code CLI and inherits local session auth (no API key needed)NSSpeechSynthesizerwithAVSpeechSynthesizerfallbackThe Cloudflare Worker (
worker/) is removed entirely.Why NSSpeechSynthesizer (deprecated) instead of AVSpeechSynthesizer?
Apple deprecated
NSSpeechSynthesizerin macOS 14 in favor ofAVSpeechSynthesizer. However,AVSpeechSynthesizercannot access Siri voices — only its own set of compact/enhanced/premium voices, which sound noticeably robotic.NSSpeechSynthesizeruses the system voice configured in Accessibility settings, which includes Siri voices and sounds dramatically better. It still works fine on macOS 14+ despite the deprecation. AnAVSpeechSynthesizerfallback is included in caseNSSpeechSynthesizerever stops working.How to run it
claude auth login)cd local-server && npm install && npm startDisclaimer
This was built almost entirely using Claude Code (Claude Opus 4.6). The implementation uses the Claude Agent SDK with local session auth, which works for personal use but is not intended for distributed applications per Anthropic's terms.
🤖 Generated with Claude Code